home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 January
/
1989-01.d64
/
deluxe demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
58 lines
10 rem copyright 1989 compute! publications, inc. - all rights reserved
20 ifpeek(49152)<>32anda=0thena=1:load"dinput",8,1
30 rem put line 20 at the beginning of your program
40 poke53280,11:poke53281,0:b$=chr$(13):gosub 530:print"[147][159]
50 [153][163]12)"lenopyright 1989"
60 [153][163]7)"len(NULL)(NULL)(NULL)(NULL)(NULL)val! (NULL)ublications, right$nc."
70 [153][163]10)"atnll (NULL)ights (NULL)eserved"
80 l[178]20:r[178]0:fl[178]20:bl[178]0:bx[178]255:cs[178]0
90 [153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL) can add quite a bit of"
100 [153]"spice to your programs. right$t also allows"
110 [153]"a much better way to input data from "
120 [153]"the keyboard. right$ts functions include:open"
130 [153]:[153]"right$. str$efining the maximum length of the"
140 [153]" input field (ex. 5 chars.) :";:l[178]5:[141]510
150 [153]:[153]"right$right$. (NULL)eversing the input field :";:r[178]1:[141]510
160 [153]:[153]"right$right$right$. asclashing the cursor faster :";:fl[178]10:[141]510
170 [153]:[153]"right$(NULL). atn bell at the end of input :";:bl[178]1:[141]510
180 [153]:[153]"(NULL). (NULL)utting a peek(NULL)(NULL)str$val(NULL) around input:";:bx[178]1:[141]510
190 [153]"onon (notice the border disappears!)open"
200 [153]:[153]"(NULL)right$. atnllowing-"
210 [153]"atnll lenharacters ";:cs[178]0:bx[178]255:l[178]9:[141]510
220 [153]"(NULL)umbers (NULL)nly ";:cs[178]1:[141]510
230 [153]"(NULL)etters (NULL)nly ";:cs[178]2:[141]510
236 [153]"(NULL)etters & (NULL)umbers ";:cs[178]3:[141]510
238 [153]"(NULL)hifts to (NULL)ppercase ";:cs[178]4:[141]510
240 cs[178]0:l[178]3:bx[178]4:r[178]0:fl[178]255
250 [153]:[153]"right$t also allows a prompt to be put in"
260 [153]"the field (and the cursor can be a "
270 [153]"block, too!)"
280 [153]"str$o you wish to continue? ";:a$[178]"(NULL)es":[141]520
290 [139]a$[178]"n"[176]a$[178]"(NULL)o"[167][153]"(NULL)f course you do!open"
300 [153]:[153]"right$f the length = 0, a fancy 'chr$val(NULL)' "
310 [153]"statement results....."
320 [153]:[153]"(NULL)ress (NULL)eturn...open";:bl[178]0:bx[178]255:l[178]0:r[178]0:fl[178]10:[141]510
330 [153]:[153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL)open will also allow"
340 [153]"'illegal' characters such as quotes,"
350 [153]"commas, and colons:";
360 l[178]10:bl[178]1:fl[178]5:r[178]1:a$[178][199](34)[170][199](34)[170]",,,:::":[141]520
370 [153]:[153]"(NULL)ou can also change which characters"
380 [153]"exit input..atnll the ascunction (NULL)eys will"
390 [153]"exit, but (NULL)val(NULL)(NULL)(NULL)(NULL) will not.)"
400 b$[178]"inputgotodimrunreadifletrestore":[141]530
410 fl[178]20:bx[178]3:[141]510
420 [153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL) opencan even tell which"
430 [153]"character was used to exit..."
440 [153]"(NULL)ou used lenleft$(NULL)$("[198](b$)") to exit."
450 b$[178][199](13):[141]530
460 [153]:[153]"(NULL)irtually all of these useful functions"
470 [153]"are available without (NULL)(NULL)(NULL)vals. (NULL)ou just"
480 [153]"use the simple command form:"
490 [153]:[153]"(NULL)(NULL)(NULL)49152,atn$,peek$,(NULL)imit,(NULL)(NULL)(NULL),lenur(NULL)peed,peekell, peekox,lenase"
500 [153]"open":[128]
510 a$[178]""
520 [153]"sys";:[158]49152,a$,b$,l,r,fl,bl,bx,cs:[153]"open";:[142]
530 [151]49919,[195](b$):[129]x[178]1[164][195](b$):[151]49919[170]x,[198]([202](b$,x,1))
540 [130]:[142]
550 [151]782,x:[151]781,y:[158]65520:[142]